<div class="form">

    <?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'news-form',
    'enableAjaxValidation' => false,
)); ?>

    <p class="note">Các trường có dấu <span class="required">*</span> là bắt buộc.</p>

    <?php echo $form->errorSummary($model); ?>
    <?php /*
	<div class="row">
		<?php echo $form->labelEx($model,'id'); ?>
		<?php echo $form->textField($model,'id'); ?>
		<?php echo $form->error($model,'id'); ?>
	</div>
     */?>

    <div class="row">
        <?php echo $form->labelEx($model, 'title'); ?>
        <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 500)); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'sapo'); ?>
        <?php echo $form->textArea($model, 'sapo', array('rows' => 6, 'cols' => 50)); ?>
        <?php echo $form->error($model, 'sapo'); ?>
    </div>


    <div class="row">

        <?php echo $form->labelEx($model, 'content'); ?>
        <?php
        $this->widget('application.extensions.ckeditor.CKEditor', array(
            'model' => $model,
            'attribute' => 'content',
            'language' => 'vi',
            //'editorTemplate' => 'full',
            //'editorTemplate' => 'advanced',
            'options' => array(
                'toolbar' => array(
                    array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'),
                    array('Image', 'Link', 'Unlink', 'Anchor'),
                ),

                //'basicEntities' => true,
                //'entities_additional' => '&quot;',
                #'entities_processNumerical' => false,
                //'entities' => false,
            ),
        ));
        ?>

        <?php
        /*
        $this->widget('application.extensions.ckeditor-v3.CKEditorWidget', array(
            "model" => $model, # Data-Model
            "attribute" => 'content', # Attribute in the Data-Model
            "defaultValue" => $model->content, # Optional
            # Additional Parameter (Check http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html)
            #Optional address settings if you did not copy ckeditor on application root
            "ckEditor" => Yii::app()->basePath . "/../scripts/ckeditor/ckeditor.php",
            # Path to ckeditor.php
            "ckBasePath" => Yii::app()->baseUrl . "/scripts/ckeditor/",

            "config" => array(
                'toolbar' => array(
                    array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'),
                    array('Image', 'Link', 'Unlink', 'Anchor'),
                ),
                //'basicEntities' => true,
                'htmlEncodeOutput' => 'false',

            ),

            # Realtive Path to the Editor (from Web-Root)
        ));
        */
        ?>

    </div>


    <div class="row">
        <?php echo $form->labelEx($model, 'avatar'); ?>
        <?php echo $form->textField($model, 'avatar', array('size' => 60, 'maxlength' => 255)); ?>
        <?php echo $form->error($model, 'avatar'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'status'); ?>
        <?php //echo $form->textField($model,'status'); ?>
        <?php echo $form->dropdownList($model, 'status', News::model()->getListStatus(), array('class' => 'span2')); ?>
        <?php echo $form->error($model, 'status'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('admin', 'Create') : Yii::t('admin', 'Save')); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->